import React, { Component } from 'react';
import pubSub from 'pubsub-js';
 class App extends Component {
 render(){
   return (
     <div>B</div>
   )
     }
     componentDidMount() {
         pubSub.subscribe('one', (msgName, { a, b, c, d }) => {
            console.log('B组件,发布后执行回调:',msgName,a,b,c,d);
         })
     }
}
 export default App;